home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dbase / techs.zip / TECH8.ZIP / CMDUPDAT.PRG next >
Text File  |  1985-11-01  |  775b  |  32 lines

  1. * Program...: Cmdupdat.PRG
  2. * Author....: Luis Castro
  3. * Date......: December 1, 1985
  4. * Version...: dBASE II, any version
  5. * Note(s)...: This program UPDATEs one database file from
  6. *             another database file in a way that is very
  7. *             similar to the dBASE II UPDATE command.
  8. *
  9. SET TALK OFF
  10. USE Mainfile
  11. SELECT SECONDARY
  12. USE Fromfile
  13. SELECT PRIMARY
  14. DO WHILE .NOT. EOF
  15.    STORE key TO mkey
  16.    SELECT SECONDARY
  17.    DO WHILE key = mkey .AND. .NOT. EOF
  18.       SELECT PRIMARY
  19.       * ---Field1 is being added to.
  20.       REPLACE Field1 WITH Field1 + S.Field1
  21.       * ---Field2 is being REPLACEd.
  22.       REPLACE Field2 WITH S.Field2
  23.       SELECT SECONDARY
  24.       SKIP
  25.    ENDDO
  26.    SELECT PRIMARY
  27.    SKIP
  28. ENDDO
  29. CLEAR
  30. RETURN
  31. * EOP Cmdupdat.PRG
  32.